home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Personal Computer World 2006 May
/
PCWMAY06.iso
/
Software
/
Freeware
/
First Page 2006 3.00
/
fp2006-final-3.00-setup.exe
/
{app}
/
Iscripts
/
Forms Misc
/
check-by-group.izs
< prev
next >
Wrap
Text File
|
2005-09-28
|
5KB
|
187 lines
<!NOWIZARD>
<!TITLE>Check By Group
<!/TITLE>
<!DESCRIPTION>This script checks all the checkboxes in a certain group, you just simply select the group from the drop down list!<!/DESCRIPTION>
<!CATEGORY>Forms<!/CATEGORY>
<!SCRIPT>
<!-- START OF SCRIPT -->
<!-- HOW TO INSTALL CHECK BY GROUP:
1. Copy code into the HEAD section of document
2. Put last coding into the BODY section of document -->
<!-- STEP ONE: Add code into HEAD section of document -->
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!-- Original: Mike Elkins (m_c_elkins@hotmail.com) -->
<!-- Begin
function selectivecheck(field, myselection)
{
var fieldid;
var pos;
var criteria;
var strng;
strng = myselection.value;
for (i=0; i<field.length; i++)
{
if (strng=="all")
{
field[i].checked = true;
}
else
{
fieldid = field[i].id;
pos = strng.substring(0,1);
criteria = strng.substring(1,2); //this gets the information we want to evaluate
if (fieldid.substring(pos,pos+1)==criteria)
{
field[i].checked = true;
}
else
{
field[i].checked = false; //you could leave this out if you don't want to clear the check boxes
}
}
}
}
// End -->
</script>
</HEAD>
<!-- STEP TWO: Add code into BODY section of document -->
<BODY>
<form>
<table align="center">
<tr><td>
<!--Load each ID with a string that will be parsed later -->
<input id=a1 type=checkbox name=list value="1">Group A SubGroup 1<br>
<input id=a2 type=checkbox name=list value="2">Group A SubGroup 2<br>
<input id=b1 type=checkbox name=list value="3">Group B SubGroup 1<br>
<input id=b2 type=checkbox name=list value="4">Group B SubGroup 2<br>
<input id=c1 type=checkbox name=list value="5">Group C SubGroup 1<br>
<input id=c2 type=checkbox name=list value="6">Group C SubGroup 2<br>
<!--Set your option values that contain a position and then the criteria-->
<p>
Group Selection: <select size="1" name="mycombobox">
<option value="all">All Groups</option>
<option value="0a ">Group A</option>
<option value="0b ">Group B</option>
<option value="0c ">Group C</option>
<option value="11 ">SubGroup 1</option>
<option value="12 ">SubGroup 2</option>
</select>
<br>
<div align="center">
<input type="button" value="Select Group" onclick=" selectivecheck(this.form.list, this.form.mycombobox)">
</div>
</td></tr>
</table>
</form>
<!-- END OF SCRIPT -->
<!/SCRIPT>
<!PREVIEW>
<!-- START OF SCRIPT -->
<!-- HOW TO INSTALL CHECK BY GROUP:
1. Copy code into the HEAD section of document
2. Put last coding into the BODY section of document -->
<!-- STEP ONE: Add code into HEAD section of document -->
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!-- Original: Mike Elkins (m_c_elkins@hotmail.com) -->
<!-- Begin
function selectivecheck(field, myselection)
{
var fieldid;
var pos;
var criteria;
var strng;
strng = myselection.value;
for (i=0; i<field.length; i++)
{
if (strng=="all")
{
field[i].checked = true;
}
else
{
fieldid = field[i].id;
pos = strng.substring(0,1);
criteria = strng.substring(1,2); //this gets the information we want to evaluate
if (fieldid.substring(pos,pos+1)==criteria)
{
field[i].checked = true;
}
else
{
field[i].checked = false; //you could leave this out if you don't want to clear the check boxes
}
}
}
}
// End -->
</script>
</HEAD>
<!-- STEP TWO: Add code into BODY section of document -->
<BODY>
<form>
<table align="center">
<tr><td>
<!--Load each ID with a string that will be parsed later -->
<input id=a1 type=checkbox name=list value="1">Group A SubGroup 1<br>
<input id=a2 type=checkbox name=list value="2">Group A SubGroup 2<br>
<input id=b1 type=checkbox name=list value="3">Group B SubGroup 1<br>
<input id=b2 type=checkbox name=list value="4">Group B SubGroup 2<br>
<input id=c1 type=checkbox name=list value="5">Group C SubGroup 1<br>
<input id=c2 type=checkbox name=list value="6">Group C SubGroup 2<br>
<!--Set your option values that contain a position and then the criteria-->
<p>
Group Selection: <select size="1" name="mycombobox">
<option value="all">All Groups</option>
<option value="0a ">Group A</option>
<option value="0b ">Group B</option>
<option value="0c ">Group C</option>
<option value="11 ">SubGroup 1</option>
<option value="12 ">SubGroup 2</option>
</select>
<br>
<div align="center">
<input type="button" value="Select Group" onclick=" selectivecheck(this.form.list, this.form.mycombobox)">
</div>
</td></tr>
</table>
</form>
<!-- END OF SCRIPT -->
<!/PREVIEW>
<!RELATED>NONE<!/RELATED>